from socket import *
import sys
import time
serverPort = 12000
serverName = ''
clientSocket = socket(AF_INET, SOCK_DGRAM)
t = time.localtime()

#每隔一秒发送一个a, 一共十个
for i in range(0, 10):

    k[i] = time.localtime()
    message = 'a'
    if(k[i]-t==i):
        clientSocket.sendto(message.encode(), serverPort)

clientSocket.close()